package com.mingqijia.gassafety.shared.cqrs;

import com.mingqijia.gassafety.shared.constant.Constants;
import lombok.experimental.SuperBuilder;

import java.util.Optional;

/**
 * @author Damon S.
 * @version v1.0.1
 * @date 2021年4月15日 21:00
 */
@SuperBuilder
public class Pageable {
    private final Long page;
    private final Long pageSize;

    public Long getPageSize() {
        return Optional.ofNullable(pageSize).orElse(Constants.PAGE_SIZE);
    }

    public Long getPage() {
        return Optional.ofNullable(page).orElse(Constants.LONG_ONE);
    }
}
